package flychess.entity;

import java.util.Random;
/**
 * 电脑玩家类
 */
public class RobotPlayer extends Player {
    public RobotPlayer() {
        this.playerType = PlayerType.ROBOT;
    }

    @Override
    public int rollDice() {
        int step;
        Random rand = new Random();
        System.out.println("(电脑玩家)" + this.getPlayerName() +
                "请您按任意键后回车启动掷骰子： \n" + this.getPlayerName() + "的输入是：" + (char)(rand.nextInt(26) + 'a'));
        step = rand.nextInt(6) + 1; // 生成1 - 6之间的随机数
        System.out.println("您掷得的骰子数为：" + step);
        return step;
    }
}
